package com.whfc.emp.enums;

/**
 * @Description: 人员报警规则类型
 * @author: sunguodong
 * @version: 1.0
 * @date: 2019/7/22 11:47
 */
public enum AppEmpWarnRuleType {

    DROP(101, "人员跌落报警", "可能从高空跌落", "跌落"),
    FALL(102, "人员摔倒报警", "可能摔倒在地", "摔倒"),
    DOFF(103, "人员脱帽报警", "脱下安全帽", "脱帽"),
    SOS(104, "人员SOS报警", "进行SOS呼叫", "SOS"),
    CRASH(105, "人员碰撞报警", "可能发生碰撞", "碰撞"),
    STILL(106, "人员静止报警", "原地静止不动", "静止"),
    FENCE(201, "人员出区域报警", "离开了范围区域", "出区"),
    LEAVE(107, "异常离开工作区域报警", "异常离开工作区域","离开" ),
    CLASSMEETING_CHECKIN(108, "班会未签到报警", "班会签到","班会" )
    ;


    private Integer value;

    private String tittle;

    private String detail;

    private String pic;

    AppEmpWarnRuleType(Integer value, String tittle, String detail, String pic) {
        this.value = value;
        this.tittle = tittle;
        this.detail = detail;
        this.pic = pic;
    }

    public Integer value() {
        return value;
    }

    public String tittle() {
        return tittle;
    }

    public String detail() {
        return detail;
    }

    public String pic() {
        return pic;
    }


    public static AppEmpWarnRuleType parseByValue(Integer value) {
        AppEmpWarnRuleType appEmpWarnRuleType = DROP;
        switch (value) {
            case 101:
                appEmpWarnRuleType = DROP;
                break;
            case 102:
                appEmpWarnRuleType = FALL;
                break;
            case 103:
                appEmpWarnRuleType = DOFF;
                break;
            case 104:
                appEmpWarnRuleType = SOS;
                break;
            case 105:
                appEmpWarnRuleType = CRASH;
                break;
            case 106:
                appEmpWarnRuleType = STILL;
                break;
            case 201:
                appEmpWarnRuleType = FENCE;
                break;
            case 107:
                appEmpWarnRuleType = LEAVE;
            case 108:
                appEmpWarnRuleType = CLASSMEETING_CHECKIN;
                break;
            default:
                break;
        }
        return appEmpWarnRuleType;
    }


    public static AppEmpWarnRuleType parseByTittle(String tittle) {
        AppEmpWarnRuleType appEmpWarnRuleType = DROP;
        switch (tittle) {
            case "人员跌落报警":
                appEmpWarnRuleType = DROP;
                break;
            case "人员摔倒报警":
                appEmpWarnRuleType = FALL;
                break;
            case "人员脱帽报警":
                appEmpWarnRuleType = DOFF;
                break;
            case "人员SOS报警":
                appEmpWarnRuleType = SOS;
                break;
            case "人员碰撞报警":
                appEmpWarnRuleType = CRASH;
                break;
            case "人员静止报警":
                appEmpWarnRuleType = STILL;
                break;
            case "人员出区域报警":
                appEmpWarnRuleType = FENCE;
                break;
            case "异常离开工作区域报警":
                appEmpWarnRuleType = LEAVE;
                break;
            case "班会未签到报警":
                appEmpWarnRuleType = CLASSMEETING_CHECKIN;
                break;
            default:
                break;
        }
        return appEmpWarnRuleType;
    }


}
